package com.cloud.cloudshop.shop.controller.redis;

import com.cloud.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/redis/lock")
public class RedisLockTest {

    @Autowired
    private StringRedisTemplate redisTemplate;

    //redis锁前缀
    private final static String LOCK_PREFIX = "redis_lock";

    //过期时间
    private final static int LOCK_EXPIRE = 5;

    /**
     * 获取redis锁，来保证高并发缓存正常
     * @return
     */
    @Autowired
    @GetMapping("/getlist")
    public R getList(){


        return R.ok();
    }

}
